package cn.edu.ujn.project.supermarket.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.edu.ujn.project.common.core.text.Convert;
import cn.edu.ujn.project.supermarket.domain.PurchaseReport;
import cn.edu.ujn.project.supermarket.mapper.PurchaseReportMapper;
import cn.edu.ujn.project.supermarket.service.IPurchaseReportService;

/**
 * 报表Service业务层处理
 * 
 * @author zhaomh
 * @date 2023-11-14
 */
@Service
public class PurchaseReportServiceImpl implements IPurchaseReportService 
{
    @Autowired
    private PurchaseReportMapper purchaseReportMapper;

    /**
     * 查询报表
     * 
     * @param 
     * @return 报表
     */
    public List<PurchaseReport>  selectPurchaseReportByPurchaseReportId(String purchaseReportId)
    {
    	return purchaseReportMapper.selectPurchaseReportByPurchaseReportId(purchaseReportId);
    }
    /**
     * 查询报表列表
     * 
     * @param purchaseReport 报表
     * @return 报表
     */
    @Override
    public List<PurchaseReport> selectPurchaseReportList(PurchaseReport purchaseReport)
    {
        return purchaseReportMapper.selectPurchaseReportList(purchaseReport);
    }

    /**
     * 新增报表
     * 
     * @param purchaseReport 报表
     * @return 结果
     */
    @Override
    public int insertPurchaseReport(PurchaseReport purchaseReport)
    {
        return purchaseReportMapper.insertPurchaseReport(purchaseReport);
    }

    /**
     * 修改报表
     * 
     * @param purchaseReport 报表
     * @return 结果
     */
    @Override
    public int updatePurchaseReport(PurchaseReport purchaseReport)
    {
        return purchaseReportMapper.updatePurchaseReport(purchaseReport);
    }

    /**
     * 批量删除报表
     * 
     * @param reportIds 需要删除的报表主键
     * @return 结果
     */
    @Override
    public int deletePurchaseReportByPurchaseReportIds(String purchaseReportIds)
    {
        return purchaseReportMapper.deletePurchaseReportByPurchaseReportIds(Convert.toStrArray(purchaseReportIds));
    }

    /**
     * 删除报表信息
     * 
     * @param reportId 报表主键
     * @return 结果
     */
    @Override
    public int deletePurchaseReportByPurchaseReportId(String purchaseReportId)
    {
        return purchaseReportMapper.deletePurchaseReportByPurchaseReportId(purchaseReportId);
    }

    @Override
    public int deletePurchaseReportByPurchaseReport(PurchaseReport purchaseReport) {
        return this.purchaseReportMapper.deletePurchaseReportByPurchaseReport(purchaseReport);
    }
}
